//
//  ParameterViewController.m
//  LearnDemo
//
//  Created by 龙 on 2018/5/21.
//  Copyright © 2018年 longlong. All rights reserved.
//

#import "ParameterViewController.h"
#import "PeopleModel.h"

@interface ParameterViewController ()

@end

@implementation ParameterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    PeopleModel *model = [[PeopleModel alloc] init];
    model.age = @"20";
    model.name = @"张三";
    int age = 10;
    NSString *name = @"1245";
    
    [self changePeopleModel:model Age:age Name:name];

    NSLog(@"旧的Model---------- %@ ： %@",model.name,model.age);
    
    NSLog(@"age %d----------  %@",age,name);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/* 疑问：
 * 为何在形参传递过程中：model中的值改变，而age与name值不变？？？？
 *
 */
- (void)changePeopleModel:(PeopleModel *)model Age:(int)age Name:(NSString *)name
{
    model.age = @"30";
    model.name = @"李四";
    
    age = 20;
    name = @"shdjg";
    
    NSLog(@"新的Model---------- %@ ： %@",model.name,model.age);
    NSLog(@"age %d----------  %@",age,name);
    
}


@end
